<template>
<div>

  <div class="chain-link-bar-wrapper">
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item>风采管理</el-breadcrumb-item>
      <el-breadcrumb-item to="/news/listOfMember">个人风采列表</el-breadcrumb-item>
      <el-breadcrumb-item :to="'/news/detailOfMember/' + news.id">风采详情：{{news.title}}</el-breadcrumb-item>
    </el-breadcrumb>  
  </div>

  <el-card class="box-card">
    
    <div slot="header" class="clearfix">
      <h3 class="app-h3 app-margin-v-0">
        个人风采详情
      </h3>
    </div>

    <div class="app-diliver-10"></div>
    
    <el-row :gutter="80">
      <el-col :span="12">
        
        <el-row>
          <el-col :span="24">
            <h4 class="app-h4 app-margin-v-0">风采信息</h4>
          </el-col>
        </el-row>

        <div class="app-diliver-10"></div>

        <el-row class="app-section">
          <el-col :span="3">
            <span class="app-label">标题：</span>
          </el-col>
          <el-col :span="20">
            <span class="app-text">{{news.title}}&nbsp;</span>
          </el-col>

          <el-col :span="3">
            <span class="app-label">简介：</span>
          </el-col>
          <el-col :span="20">
            <span class="app-text">{{news.intro}}&nbsp;</span>
          </el-col>

          <el-col :span="3">
            <span class="app-label">添加时间：</span>
          </el-col>
          <el-col :span="20">
            <span class="app-text">{{news.date_time_str}}&nbsp;</span>
          </el-col>
          <el-col :span="3">
            <span class="app-label">封面：</span>
          </el-col>
          <el-col :span="20">
            <el-image class="section-img-200" v-for="img in news.coverList" :preview-src-list="news.coverList" :src="img" />
            <span>&nbsp;</span>
          </el-col>
          <el-col :span="3">
            <span class="app-label">详情图片：</span>
          </el-col>
          <el-col :span="20">
             <el-image class="section-img-200" v-for="img in news.newsDetailList"  :preview-src-list="news.newsDetailList" :src="img" />
          </el-col>

        </el-row>
      </el-col>

      <el-col :span="12">

        <el-row>
          <el-col :span="24">
            <h4 class="app-h4 app-margin-b-0">个人信息 & 公司信息</h4>
          </el-col>
        </el-row>

        <div class="app-diliver-10"></div>

        <el-row class="app-section">
          <el-col :span="3">
            <span class="app-label">发布人：</span>
          </el-col>
          <el-col :span="20">
            <span class="app-text">{{account.last_name + account.first_name}}</span>
          </el-col>
          <el-col :span="3">
            <span class="app-label">手机号：</span>
          </el-col>
          <el-col :span="20">
            <span class="app-text">{{account.phone}}</span>
          </el-col>
          <el-col :span="3">
            <span class="app-label">公司名称：</span>
          </el-col>
          <el-col :span="20">
            <span class="app-text">{{company.name}}</span>
          </el-col>
          <el-col :span="3">
            <span class="app-label">公司座机：</span>
          </el-col>
          <el-col :span="20">
            <span class="app-text">{{company.company_tel == '' ? "暂无座机" : company.company_tel}}</span>
          </el-col>
          <el-col :span="3">
            <span class="app-label">公司地址：</span>
          </el-col>
          <el-col :span="20">
            <span class="app-text">
              {{company.address_detail}}&nbsp;
            </span>
          </el-col>
        </el-row>

      </el-col>

    </el-row>
    
    

  </el-card>

</div>
</template>


<script>

  import NcButton from '../common/NcButton'
  import SubmitButton from '../common/SubmitButton'

  import Api from '../../api/Api'
  import NewsApi from '../../api/NewsApi'



  export default {
  	components: {
  		NcButton, SubmitButton
  	},
  	data(){
  	  return {
        
        newsId: 0,
        
        news: {},
        account: {},
        company: {},
  	  }
  	},
  	computed: {
  	  
  	},
  	created(){
  	  this.newsId = this.$route.params.newsId;
      this.getNews();
  	},
    watch: {
      '$route' (to, from) {
        this.newsId = to.params.newsId;
        this.getNews();
      }
    },
  	methods: {
      getNews(){
        NewsApi.detailOfMember(this.newsId, json => {
          this.news = json.news;
          this.account = json.news.account;
          this.company = json.news.company;
		  console.log(json)
        });
      }
  	}
  }
</script>

